package date0704am;

import cn.edu.ecut.util.DatabaseType;
import cn.edu.ecut.util.JdbcHelper;


public class JdbcTest22 {

	public static void main(String[] args) {
		
		JdbcHelper h = JdbcHelper.getInstance( DatabaseType.MYSQL ) ;
		
		int count ;
		
		// DML: insert | update | delete
		
		String delete = "DELETE FROM t_accounts WHERE id = 3 ;" ;
		count = h.update( delete ) ;
		System.out.println( count );
		
		String insert = "INSERT INTO t_accounts VALUES ( ? , ? , ? , ? ) " ;
		count = h.update( insert , 3 , "100200300400" , 10000 , "张三丰" ) ;
		System.out.println( count );
		
		String update = "UPDATE t_accounts SET balance = balance + 1000 WHERE id = ? " ;
		count = h.update( update , 3 ) ;
		System.out.println( count );
		
		h.release();

	}

}
